import { Size, ccenum } from "cc"
import { CubeEntity } from "../../../../scene/script/entity/CubeEntity"
import { Rectangle, Vector2 } from "../../Main"
import { CubeNuoEntity } from "../../../../scene/script/entity/CubeNuoEntity"

export enum EEntityType {
    None,
    Cube,
    Drag,
    Effect,

}

export enum EPropId {
    /**提示 */
    tip = 1,
    /**消除 */
    remove = 2,
    /**洗牌 */
    reset = 3,
    time = 7,
    /**体力 */
    power = 8,
}
ccenum(EPropId)

/**房间加载的优先级排序 越前越先加载*/
export const CResoucesLoadPriority: EEntityType[] = [

]


export interface ILogicData {
    dataIndex: number
    entity: CubeEntity,
    configId: number,
    index: Vector2,
    rect: Rectangle,
    isBottom: boolean,
    state: ELogicDataState
}


export interface ILogicNuoData {
    dataIndex: number
    entity: CubeNuoEntity,
    configId: number,
    index: Vector2,
    rect: Rectangle,
    isRemove: boolean,
}

export interface ILogicNuoMoveSameData {
    indexs: [number, number],
    dir: [number, number],
    removeCount: number,
    moveCount: number,
}

export const CNuoDirV2 = [
    new Vector2(1, 0),
    new Vector2(-1, 0),
    new Vector2(0, 1),
    new Vector2(0, -1),
]

export enum ELogicDataState {
    /**已消除 空的 */
    none,
    /**背面 */
    back,
    /**有牌 可操作 */
    card,
    /**上方有牌 */
    cardStatic,
}


export const CSceneData = {
    cubePrefabUrl: "scene/prefab/entity/CubeEntity",
    moveAnimPrefabUrl: "scene/prefab/entity/MoveAnimEntity",
    selectionPrefabUrl: "scene/prefab/entity/SelectionEntity",
    cubeAnimPrefabUrl: "scene/prefab/entity/CubeAnimEntity",
    tipPrefabUrl: "scene/prefab/entity/TipEntity",
    dragPrefabUrl: "scene/prefab/entity/DragEntity",

    removeParticle: "main/particle/12/prefab",


    cubeNuoPrefabUrl: "scene/prefab/entity/CubeNuoEntity",

    audio: {
        drag: "sceneRes/audio/drag"
    }
}


export const CCubeSize = new Size(103, 131)
/**前多少步不出现对对牌 */
export const CfirsetSame = 5

